<template>
	<view class="outBox">
		<u-navbar leftText="我的账户" leftIconColor="#fff" :autoBack="true" bgColor="#242331">
			<view class="left-slot" slot="left">
				 <u-icon name="arrow-left" color="#fff"></u-icon>
				<text>我的账户</text>
			</view>
		</u-navbar>
		<view class="content" :style="{
			marginTop:menuHeight + 'px',
				minHeight:` calc(100vh - ${menuHeight}px)`
		}">
			<view class="accountBox">
				<view class="bg">
<!--					<image src="../../static/mine/userBg.png" mode="scaleToFill"></image>-->
				</view>
				<view class="title">
					电子会员卡
				</view>
				<view class="money">
					<text class="price">{{money}} </text> <text class="unit">元</text>
				</view>
				<view class="btns">
					<view class="btn" @click="getnav('/pages/mine/balance')">
						消费明细
					</view>
				</view>
			</view>
			<view class="list">
				<view class="tit">
					近三个月消费明细
				</view>
				<view class="item">
					<view class="left">
						<text class="name">消费</text>
						<text class="time">6月20日 19:26</text>
					</view>
					<view class="right">
						<text>-500</text>
					</view>
				</view>
				<view class="item">
					<view class="left">
						<text class="name">用户下单</text>
						<text class="time">6月20日 19:26</text>
					</view>
					<view class="right">
						<text>+200</text>
					</view>
				</view>
				<view class="item">
					<view class="left">
						<text class="name">体现</text>
						<text class="time">6月20日 19:26</text>
					</view>
					<view class="right">
						<text>-200</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getWXStatusHeight
	} from '@/utils/index.js'
	export default {
		data() {
			return {
				// 胶囊的宽度
				barWidth: 0,
				menuHeight: 0,
				money: 2000,
			}
		},
		onLoad() {
			let obj = getWXStatusHeight()
			this.barWidth = obj.barWidth + 3
			this.menuHeight = obj.menuHeight
			console.log(obj,"obj");
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.list {
		margin-top: 40rpx;
		color: #fff;

		.item {
			display: flex;
			justify-content: space-between;
			height: 100rpx;
			align-items: center;
			color: #fff;
			padding: 0 40rpx;
			background-color: #0e0d15;
			border-radius: 20rpx;
			margin-top: 30rpx;

			.left {
				display: flex;
				justify-content: center;
				flex-direction: column;

				.time {
					font-size: 22rpx;
					color: #8b8b8b;
				}
			}
		}

		.tit {
			margin-top: 40rpx;
		}
	}

	.btns {
		display: flex;
		justify-content: center;
		margin-top: 50rpx;
		position: relative;
		z-index: 99;

		.btn {
			padding: 10rpx 30rpx;
			color: #fff;
			border-radius: 10rpx;
			font-size: 26rpx;
			background-color: #5aa10c;
		}
	}

	.accountBox {
		width: 100%;
		height: 350rpx;
		position: relative;
		padding: 25rpx;
		box-sizing: border-box;
		color: #fff;

		.title {
			position: absolute;
			left: 30rpx;
			top: 30rpx;
			font-size: 36rpx;
		}

		.money {
			color: #fff;
			position: relative;
			z-index: 99;
			text-align: center;
			margin-top: 80rpx;

			.price {
				font-size: 60rpx;
				margin-right: 20rpx;
			}
		}

		.bg {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 100%;
			border-radius: 20rpx;
			overflow: hidden;

			image {
				width: 100%;
				height: 100%;
			}
		}
	}

	.content {
		position: relative;
		padding: 20rpx 40rpx;
		box-sizing: border-box;
		min-height: calc(100vh - 40rpx);
	}

	.left-slot {
		color: #fff;

		image {
			width: 40rpx;
			margin-right: 30rpx;
		}
	}

	.outBox {
		background-color: #242331;
	}
</style>
